package com.siwei.apply.mapper;

import com.siwei.apply.domain.Workflow;
import com.siwei.apply.domain.res.ProjectCycleRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface WorkflowMapper {
    /** 根据项目类型与业务表名获取流程定义 */
    Workflow selectByProjectTypeAndTableName(@Param("projectType") Integer projectType,
                                             @Param("tableName") String tableName);
    /** 获取小于当前节点index的上一个流程节点 */
    Workflow selectPrevByProjectTypeAndTableName(@Param("projectType") Integer projectType,
                                                 @Param("tableName") String tableName);

    /** 根据 project_type 获取流程列表，按 index 升序返回 */
    List<ProjectCycleRes> selectByProjectTypeOrderByIndex(@Param("projectType") Integer projectType);
}
